<template>
  <div class="home-swipe">
     <van-swipe :autoplay="3000">
      <van-swipe-item v-for="(item, index) in banners" :key="index">
        <img v-lazy="item.imageUrl" :src="item.imageUrl"/>
      </van-swipe-item>
    </van-swipe>

  </div>
</template>
<script>
export default {
  data(){
    return{
      banners: [],
    }
  },
  created(){
    this.getData()
  },
  methods:{
    getData(){
      this.$request('get','/banner').then((res)=>{
        console.log(res);
          this.banners = res.banners;
      })
    }
  }
}
</script>
<style scoped>
img {
  width:100%;
}
</style>